class Branch < ActiveRecord::Base
  has_many :user
  has_many :customer

  validates_presence_of :code , :name
  validates_numericality_of :code , :integer_only=>true
  validates_length_of :code ,:is => 3
  validates_uniqueness_of :code

  attr_accessor :user_log
  def to_audit
    return "ID:#{id}"+","+":Code#{code}"+","+"Name:#{name}"
  end

end
